#include <bits/stdc++.h>
#define gc getchar
#define pc putchar
#define pt printf
#define IL inline
using namespace std;
const int Mxn=2e5+5;
int N,Q,A[Mxn],P[Mxn];
IL int _() {
	int x=0,f=0;char ch=gc();
	while(ch<'0'||ch>'9') f|=(ch=='-'),ch=gc();
	while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+(ch^48),ch=gc();
	return f?-x:x;
}
IL void __(int x) {
	int stk[30],tp=0;
	if(x<0) x=-x,pc('-');
	do stk[++tp]=x%10,x/=10;while(x);
	while(tp) pc(stk[tp--]^48);
}
int Max(int x,int y) {return x>y?x:y;}
int Min(int x,int y) {return x<y?x:y;}
int Solve(int x,int y,int a,int b) {
	if(x==N||y==N) return a;
	int Res=x<y?0:P[N];
	if(x<y) {
		for(int i=y+1;i<=N;++i) {
			Res=Max(Res,Solve(i,i-1,a+A[i],b+P[i-1]-P[y]));
		}
	}
	else {
		for(int i=x+1;i<=N;++i) {
			Res=Min(Res,Solve(i-1,i,a+P[i-1]-P[x],b+A[i]));
		} 
	}
	return Res;
}
signed main() {
	freopen("pockets.in","r",stdin);
	freopen("pockets.out","w",stdout);
	N=_();
	for(int i=1;i<N;++i) A[i]=_(),P[i]=P[i-1]+A[i];
	Q=_();
	while(Q--) {
		A[N]=_(),P[N]=P[N-1]+A[N];
//		pt("The Answer Is______________");
		__(2*Solve(1,2,A[1],A[2])-P[N]),pc('\n');
	}
	return 0;
}
